﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="DirectorioPersonas.aspx.cs" Inherits="DirectorioPersonas" ResponseEncoding="iso-8859-1" %>

<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxCallback" TagPrefix="dx" %>
<%@ Register TagPrefix="dx" Namespace="DevExpress.Web.ASPxCallbackPanel" Assembly="DevExpress.Web.v10.2, Version=10.2.8.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" %>
<%@ Register TagPrefix="anthem" Namespace="Anthem" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <script type="text/javascript">
    // <![CDATA[


        function ShowLoginWindow() {
            popupDetalle.Show();
        }
        function ShowCreateAccountWindow() {
            pcCreateAccount.Show();
            tbUsername.Focus();
        }

        var keyValue;
        function OnMoreInfoClick(element, key) {
            callbackPanel.SetContentHtml("");
            popup.ShowAtElement(element);
            keyValue = key;
        }
        function popup_Shown(s, e) {
            callbackPanel.PerformCallback(keyValue);
        }
    // ]]> 
    </script>
    <table width="100%">
        <tr>
            <td>
                <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" HeaderText="Directorio de Personas"
                    Width="100%" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" CssPostfix="Office2003Blue"
                    EnableDefaultAppearance="False" GroupBoxCaptionOffsetY="-25px" SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                    <ContentPaddings Padding="2px" PaddingBottom="10px" PaddingTop="10px" />
                    <HeaderStyle>
                        <Paddings Padding="0px" PaddingBottom="7px" PaddingLeft="2px" PaddingRight="2px" />
                    </HeaderStyle>
                    <PanelCollection>
                        <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                            <dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css"
                                CssPostfix="Office2003Blue" DataSourceID="SqlDataSource1" Width="100%" KeyFieldName="AGE_ID">
                                <Columns>
                                    <dx:GridViewDataTextColumn FieldName="AGE_NOMBRES_APELLIDOS" Width="250px" ShowInCustomizationForm="True"
                                        VisibleIndex="0" FixedStyle="Left" CellStyle-BackColor="#ffffd6" Caption="Nombre">
                                        <DataItemTemplate>
                                            <a href="javascript:void(0);" onclick="OnMoreInfoClick(this, '<%# Container.KeyValue %>')">
                                                <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text='<%#Eval("AGE_NOMBRES_APELLIDOS")%>'>
                                                </dx:ASPxLabel>
                                            </a>
                                        </DataItemTemplate>
                                        <CellStyle BackColor="#FFFFD6">
                                        </CellStyle>
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataComboBoxColumn FieldName="Departamento" ShowInCustomizationForm="True"
                                        VisibleIndex="1">
                                        <PropertiesComboBox DataSourceID="SqlDataSourceDepartamentos" ValueField="DEPARTAMENTO"
                                            TextField="DEPARTAMENTO" ValueType="System.String" IncrementalFilteringMode="StartsWith"
                                            DropDownStyle="DropDown" />
                                    </dx:GridViewDataComboBoxColumn>
                                    <dx:GridViewDataTextColumn FieldName="Municipio" ShowInCustomizationForm="True" VisibleIndex="2">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Practica artística" FieldName="AGE_DESARROLLO_PRACTICA_ARTISTICA"
                                        ShowInCustomizationForm="True" VisibleIndex="3">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn FieldName="AGE_MANERA_PRACTICA_ARTISTICA" ShowInCustomizationForm="True"
                                        VisibleIndex="4" Caption="Tipo">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Area" FieldName="ARD_AREA_ARTISTICA" ShowInCustomizationForm="True"
                                        VisibleIndex="5">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Tema" FieldName="AGE_OTRA_AREA_ARTISTICA_TEMA"
                                        ShowInCustomizationForm="True" VisibleIndex="6">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataTextColumn Caption="Correo" Width="250px" FieldName="AGE_CORREO_ELECTRONICO"
                                        ShowInCustomizationForm="True" VisibleIndex="7">
                                    </dx:GridViewDataTextColumn>
                                    <dx:GridViewDataColumn Caption="Mas info..." VisibleIndex="8" Width="100px">
                                        <DataItemTemplate>
                                            <a href="javascript:void(0);" onclick="OnMoreInfoClick(this, '<%# Container.KeyValue %>')">
                                                <dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Mas info...">
                                                </dx:ASPxLabel>
                                            </a>
                                        </DataItemTemplate>
                                    </dx:GridViewDataColumn>
                                </Columns>
                                <SettingsBehavior ColumnResizeMode="Control" />
                                <Settings ShowHorizontalScrollBar="True" ShowFilterRow="True" ShowGroupPanel="True" />
                                <SettingsText GroupPanel="Arrastre AQUI los encabezados de las columnas para agrupar  la información" />
                                <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                    <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                                    </LoadingPanelOnStatusBar>
                                    <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                                    </LoadingPanel>
                                </Images>
                                <ImagesFilterControl>
                                    <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                                    </LoadingPanel>
                                </ImagesFilterControl>
                                <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" CssPostfix="Office2003Blue">
                                    <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                    </Header>
                                    <LoadingPanel ImageSpacing="10px">
                                    </LoadingPanel>
                                </Styles>
                                <StylesEditors>
                                    <ProgressBar Height="25px">
                                    </ProgressBar>
                                </StylesEditors>
                            </dx:ASPxGridView>
                        </dx:PanelContent>
                    </PanelCollection>
                </dx:ASPxRoundPanel>
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <dx:ASPxPopupControl ID="popup" ClientInstanceName="popup" runat="server" AllowDragging="True"
                    PopupHorizontalAlign="OutsideRight" HeaderText="Detalle Personas" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                    CssPostfix="Office2010Blue" EnableHotTrack="False" SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                    </LoadingPanelImage>
                    <LoadingPanelStyle ImageSpacing="5px">
                    </LoadingPanelStyle>
                    <ContentCollection>
                        <dx:PopupControlContentControl ID="PopupControlContentControl1" runat="server">
                            <dx:ASPxCallbackPanel ID="callbackPanel" ClientInstanceName="callbackPanel" runat="server"
                                Width="520px" Height="300px" OnCallback="callbackPanel_Callback" RenderMode="Table">
                                <PanelCollection>
                                    <dx:PanelContent runat="server">
                                        <table style="width: 100%;">
                                            <tr>
                                                <td colspan="2" align="left">
                                                    <table width="100%">
                                                        <tr>
                                                            <td class="fondoGris">
                                                                 CONTACTO :
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 129px">
                                                    Nombre
                                                </td>
                                                <td>
                                                    <asp:Literal ID="litText" runat="server" Text=""></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 129px">
                                                    Dirección
                                                </td>
                                                <td>
                                                    <asp:Literal ID="litDireccion" runat="server" Text=""></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 129px">
                                                    Telefono
                                                </td>
                                                <td>
                                                    <asp:Literal ID="litTelefono" runat="server" Text=""></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 129px">
                                                    Correo Electrónico
                                                </td>
                                                <td>
                                                    <asp:Literal ID="litCorreo" runat="server" Text=""></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 129px">
                                                    Departamento
                                                </td>
                                                <td>
                                                    <asp:Literal ID="litDepartamento" runat="server" Text=""></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 129px">
                                                    Municipio
                                                </td>
                                                <td>
                                                    <asp:Literal ID="litMunicipio" runat="server" Text=""></asp:Literal>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="width: 129px">
                                                    Sitios Web
                                                </td>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </dx:PanelContent>
                                </PanelCollection>
                            </dx:ASPxCallbackPanel>
                        </dx:PopupControlContentControl>
                    </ContentCollection>
                    <ClientSideEvents Shown="popup_Shown" />
                </dx:ASPxPopupControl>
            </td>
        </tr>
    </table>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SIPAConnectionString %>"
        SelectCommand="SELECT ART_AGENTES.AGE_ID, BAS_ZONAS_GEOGRAFICAS_1.ZON_NOMBRE AS Municipio, BAS_ZONAS_GEOGRAFICAS.ZON_NOMBRE AS Departamento, ART_AGENTES.AGE_NOMBRES_APELLIDOS, (CASE  ART_AGENTES_CARACTERISTICAS.AGE_DESARROLLO_PRACTICA_ARTISTICA WHEN 'S' THEN 'Si' WHEN 'N' THEN 'No' ELSE ART_AGENTES_CARACTERISTICAS.AGE_DESARROLLO_PRACTICA_ARTISTICA END) AS AGE_DESARROLLO_PRACTICA_ARTISTICA,  (CASE  ART_AGENTES_CARACTERISTICAS.AGE_MANERA_PRACTICA_ARTISTICA WHEN 'P' THEN 'Profesional' WHEN 'A' THEN 'Aficionado' ELSE ART_AGENTES_CARACTERISTICAS.AGE_MANERA_PRACTICA_ARTISTICA END) AS AGE_MANERA_PRACTICA_ARTISTICA, ART_AREA_ARTISTICAS.ARD_AREA_ARTISTICA, ART_AGENTES_CARACTERISTICAS.AGE_OTRA_AREA_ARTISTICA_TEMA, ART_AGENTES_UBICACION.AGE_CORREO_ELECTRONICO FROM BAS_ZONAS_GEOGRAFICAS INNER JOIN BAS_ZONAS_GEOGRAFICAS AS BAS_ZONAS_GEOGRAFICAS_1 INNER JOIN ART_AGENTES_CARACTERISTICAS INNER JOIN ART_AGENTES ON ART_AGENTES_CARACTERISTICAS.AGE_ID = ART_AGENTES.AGE_ID INNER JOIN ART_AREA_ARTISTICAS ON ART_AGENTES_CARACTERISTICAS.ARD_ID = ART_AREA_ARTISTICAS.ARD_ID INNER JOIN BAS_ZONAS_PAISES ON ART_AGENTES.ZOP_ID = BAS_ZONAS_PAISES.ZOP_ID INNER JOIN ART_AGENTES_UBICACION ON ART_AGENTES.AGE_ID = ART_AGENTES_UBICACION.AGE_ID ON BAS_ZONAS_GEOGRAFICAS_1.ZON_ID = ART_AGENTES_UBICACION.BAS_ZON_ID ON BAS_ZONAS_GEOGRAFICAS.ZON_ID = BAS_ZONAS_GEOGRAFICAS_1.ZON_PADRE_ID WHERE (ART_AGENTES.AGE_ESTADO = 'P') AND (ART_AGENTES_CARACTERISTICAS.ARD_ID = 16)">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSourceDepartamentos" runat="server" ConnectionString="<%$ ConnectionStrings:SIPAConnectionString %>"
        SelectCommand="SELECT ZON_NOMBRE AS DEPARTAMENTO FROM dbo.BAS_ZONAS_GEOGRAFICAS WHERE ZON_PADRE_ID IS NULL">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSourceMunicipios" runat="server" ConnectionString="<%$ ConnectionStrings:SIPAConnectionString %>"
        SelectCommand="SELECT ZON_NOMBRE AS MUNICIPIO FROM dbo.BAS_ZONAS_GEOGRAFICAS WHERE   ZON_PADRE_ID IS NOT NULL">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSourceDetalles" runat="server" ConnectionString="<%$ ConnectionStrings:SIPAConnectionString %>"
        SelectCommand="SELECT BAS_ZONAS_GEOGRAFICAS_1.ZON_NOMBRE AS Municipio, BAS_ZONAS_GEOGRAFICAS.ZON_NOMBRE AS Departamento, ART_AGENTES.AGE_NOMBRES_APELLIDOS, (CASE  ART_AGENTES_CARACTERISTICAS.AGE_DESARROLLO_PRACTICA_ARTISTICA WHEN 'S' THEN 'Si' WHEN 'N' THEN 'No' ELSE ART_AGENTES_CARACTERISTICAS.AGE_DESARROLLO_PRACTICA_ARTISTICA END) AS AGE_DESARROLLO_PRACTICA_ARTISTICA,  (CASE  ART_AGENTES_CARACTERISTICAS.AGE_MANERA_PRACTICA_ARTISTICA WHEN 'P' THEN 'Profesional' WHEN 'A' THEN 'Aficionado' ELSE ART_AGENTES_CARACTERISTICAS.AGE_MANERA_PRACTICA_ARTISTICA END) AS AGE_MANERA_PRACTICA_ARTISTICA, ART_AREA_ARTISTICAS.ARD_AREA_ARTISTICA, ART_AGENTES_CARACTERISTICAS.AGE_OTRA_AREA_ARTISTICA_TEMA, ART_AGENTES_UBICACION.AGE_CORREO_ELECTRONICO FROM BAS_ZONAS_GEOGRAFICAS INNER JOIN BAS_ZONAS_GEOGRAFICAS AS BAS_ZONAS_GEOGRAFICAS_1 INNER JOIN ART_AGENTES_CARACTERISTICAS INNER JOIN ART_AGENTES ON ART_AGENTES_CARACTERISTICAS.AGE_ID = ART_AGENTES.AGE_ID INNER JOIN ART_AREA_ARTISTICAS ON ART_AGENTES_CARACTERISTICAS.ARD_ID = ART_AREA_ARTISTICAS.ARD_ID INNER JOIN BAS_ZONAS_PAISES ON ART_AGENTES.ZOP_ID = BAS_ZONAS_PAISES.ZOP_ID INNER JOIN ART_AGENTES_UBICACION ON ART_AGENTES.AGE_ID = ART_AGENTES_UBICACION.AGE_ID ON BAS_ZONAS_GEOGRAFICAS_1.ZON_ID = ART_AGENTES_UBICACION.BAS_ZON_ID ON BAS_ZONAS_GEOGRAFICAS.ZON_ID = BAS_ZONAS_GEOGRAFICAS_1.ZON_PADRE_ID WHERE (ART_AGENTES.AGE_ESTADO = 'P') AND (ART_AGENTES_CARACTERISTICAS.ARD_ID = 16)">
    </asp:SqlDataSource>
</asp:Content>
